<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="s"  uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

ValueStack访问值:
<s:property value="userName"/>
<hr>
ActionContext.getContext().put("key","value")中的普通值:
<s:property value="password"/>
<hr>
action属性:
<s:property value="name"/>
<hr>
不通过action访问uri里面的值:
<span style="color:red"><s:property value="#parameters.name"/></span><br>
标签访问request中的属性值:
<s:property value="#request.company"/><br>
标签访问session中的属性值:
<s:property value="#session.school"/><br>
标签访问application中的属性值:
<s:property value="#application.num"/>
<hr>

if elseif 标签:
<s:set var="testname" value="'777'"></s:set>
<s:if test="#testname=='666'">is 666</s:if>
<s:elseif test="#testname=='777'">is 777</s:elseif>
<s:else>没东西</s:else>
<hr>
<s:set var="myname" value="'为什么我的不行'"></s:set>
<s:property value="myname"/>
<s:property value="#myname"/>
<hr>
迭代器<br>
<s:set var="companyNames" value="{'百度','腾讯','阿里'}"></s:set>
<s:iterator value="#companyNames" var="company">
<s:property value="company"/>
</s:iterator>
<hr>
利用默认的工具（时间）<br>
<s:bean name="java.util.Date" var="date"></s:bean>
<s:date name="#date" format="yyyy-MM-dd"/>
<hr>
利用自己设置好的实体类<br>
<s:bean name="com.mashensoft.User" var="u">
<s:param name="name" value="'小小'"></s:param>
</s:bean>
<s:property value="#u.name"/>
<hr>
debug显示
<s:debug></s:debug>
<hr>
调用并包含调用结果到此页面:
<s:action name="HelloWorld" executeResult="true"></s:action><br>
调用不包含调用结果到此页面:
<s:action name="HelloWorld" executeResult="false"></s:action>
<hr>
comparator排序:<br>
<s:bean name="com.mashensoft.MyComparator" var="myComparator"></s:bean>
<s:sort comparator="#myComparator" source="{'apple','orange','banana'}" var="mydata"></s:sort>
<s:iterator value="#attr.mydata"><s:property/><br></s:iterator>
<hr>
<s:updownselect name="a" label="请选择" list="{'banana','apple','aaaa','bbbbb','ccccc','cccc','ccddcc'}" labelposition="top" moveUpLabel="向上移动" moveDownLabel="向下移动" selectAllLabel="全选" style="width:100px;"></s:updownselect>
<hr>
复选框<br>
<s:checkboxlist list="{'苹果','香蕉','橘子'}" name="fruit" label="水果"></s:checkboxlist>
<hr>
<s:form>
<s:combobox list="#{'red':'red','123':'123','1':'1','2':'2' }" name="num" headerKey="" headerValue="请选择" labelposition="top" label="请选择" size="20" onchange="" maxlength="20" style="width:100px"></s:combobox>
</s:form>
<hr>
<s:select list="#{'曹营':'夏侯惇','汉营':'关羽' }" listKey="key" listValue="value" headerKey="" headerValue="请选择"></s:select>
<hr>
<s:select name="country3" list="{}" listKey="key" listValue="value"
		headerKey="" headerValue="请选择">
		<s:optgroup label="广东省" list="#{'gz':'广州','st':'汕头'}" listKey="key"
			listValue="value"></s:optgroup>
		<s:optgroup label="广西省" list="#{'gl':'桂林','nn':'南宁'}" listKey="key"
			listValue="value"></s:optgroup>
	</s:select>
	<hr>
	<s:radio list="{'red','blue'}" name="color" label="你最喜欢的颜色"></s:radio>
	<hr>
	双向选择<br>
	<s:optiontransferselect label="请选择项目" name="project"
		doubleList="{'struts1','struts2'}"
		list="{'filterdemo','hibernate2','hibernate3','tag'}" multiple="true"
		addToLeftLabel="删除" addToRightLabel="添加" selectAllLabel="全部选择"
		addAllToLeftLabel="全部删除" addAllToRightLabel="全部添加"
		doubleName="chooseProject" doubleMultiple="true"></s:optiontransferselect>
</body>
</html>